package com.itheima.jdk8date;

import java.time.LocalDateTime;

public class Demo03 {

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime dateTime = now.plusYears(5);//5年之后
        System.out.println(dateTime);
        LocalDateTime dateTime1 = now.minusMonths(30);//30个月之前
        System.out.println(dateTime1);

        //minus 5你那之后
        LocalDateTime dateTime2 = now.minusYears(-5);
        System.out.println(dateTime2);

        LocalDateTime dateTime3 = now.plusMonths(-30);
        System.out.println(dateTime3);

    }
}
